package cn.desk.dialog.entity;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Transient;

import cn.desk.commons.entity.BaseEntity;

@Entity(name = "t_button")
@IdClass(Button.class)
public class Button extends BaseEntity implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@Id
	@ManyToOne
	@JoinColumn(name = "dialog", referencedColumnName = "id")
	private Dialog dialog;
	@Id
	@Column(name = "name")
	private String name;

	private String func;
//	private String description;

	@Override
	@Transient
	public Object getValue() {
		return name;
	}

	@Override
	@Transient
	public String getDisplayName() {
		return "按钮";
	}

	public Dialog getDialog() {
		return dialog;
	}

	public void setDialog(Dialog dialog) {
		this.dialog = dialog;
	}

	public String getFunc() {
		return func;
	}

	public void setFunc(String func) {
		this.func = func;
	}

	@Transient
	public Button getId() {
		return this;
	}

	public void setId(Button id) {

	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
//
//	public String getDescription() {
//		return description;
//	}
//
//	public void setDescription(String description) {
//		this.description = description;
//	}
}
